<!--空白页面参考模版-->
{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">


    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <form id="dataForm" class="dataForm form-horizontal" method="post" onsubmit="return send()"
                      enctype="multipart/form-data">
                    <div class="box-body">
                        <div class="fields-group">
                            <div class="form-group">
                                <label for="mobile" class="col-sm-2 control-label">手机号</label>
                                <div class="col-sm-8">
                                    <div class="input-group">
                                        <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                                        <input name="mobile" id="mobile" maxlength="11" class="form-control"
                                               placeholder="请输手机号">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">发送结果</h3>
                </div>
                <div class="box-body">
                    <div style="text-align: center" id="result">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        function send() {
            var mobile = $("#mobile").val();
            $.ajax({
                url: '{:url("sendSms")}',
                type: "post",
                data: {
                    mobile: mobile
                },
                dataType: 'json',
                cache: false,
                async: false,
                success: function (result) {

                    $("#result").html(result.msg);
                    layer.msg(result.msg);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.msg("系统异常，请稍后重试");
                }
            });

            return false;
        }

    </script>


</section>

{/block}